@echo off


setlocal enabledelayedexpansion


REM 获取当前系统时间
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a
set year=!datetime:~0,4!
set month=!datetime:~4,2!
set day=!datetime:~6,2!

REM 构建 commit 备注
set commit_msg=Auto commit at %year%-%month%-%day%
cd /d E:\www\dxx

echo Adding changes...
git add .

REM 将用户输入的参数添加到提交消息中
echo Committing changes...
git commit -m "%commit_msg%"

echo Pulling changes from remote repository...
git pull origin master

echo Pushing changes to remote repository...
git push origin master

echo Done.

endlocal